// 封装接口的引入
import request from '@/utils/request'

// 获取权限列表
export function getPermList() {
  return request({
    url: '/sys/permission'
  })
}
// 根据id获取详情  /sys/permission/{id}

export function getPermDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}

// 编辑权限 /sys/permission/{id}
export function updatePerm(data) {
  return request({
    method: 'put',
    url: `/sys/permission/${data.id}`,
    data
  })
}

// 添加权限接口 /sys/permission
export function addPerm(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 删除权限/sys/permission/{id}
export function deletePerm(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}

